package com.tanxi521.springboot.service.impl;

import com.tanxi521.springboot.mapper.BanItemMapper;
import com.tanxi521.springboot.pojo.BanItem;
import com.tanxi521.springboot.pojo.Page;
import com.tanxi521.springboot.service.BanItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: i-xiaotian
 * @Date: 2022/4/9 22:31
 * @EMAIL: 1254806967@qq.com
 */
@Service
public class BanItemServiceImpl implements BanItemService {

    @Autowired
    BanItemMapper banItemMapper;

    @Override
    public List<BanItem> queryBanItemList(Integer pageSize, Integer pageIndex) {
        Page page = new Page(pageIndex, pageSize);
        return banItemMapper.selectBanItemList(page);
    }

    @Override
    public int queryBanItemCount() {
        return banItemMapper.selectBanItemCount();
    }

    @Override
    public int insertBanItem(BanItem banItem) {
        return banItemMapper.insert(banItem);
    }

    @Override
    public int deleteBanItem(List<Integer> ids) {
        return banItemMapper.deleteByPrimaryKeyList(ids);
    }
}
